/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FacultyUI.java
 *
 * Created on 11 1, 11, 9:49:09 PM
 */
package introsemp;

import javax.swing.*;

/**
 *
 * @author Marit
 */
public class FacultyUI extends javax.swing.JPanel {

    /** Creates new form FacultyUI */
    JFrame frame;
    public FacultyUI() {
        initComponents();
        JLabel bg = new JLabel(new ImageIcon("Images\\manage faculty.png"));
        bg.setSize(930, 686);
        add(bg);
        bg.setVisible(true);
    }

    public void remove() {
        frame.remove(this);
    }
    public void setFrame(JFrame frame) {
        this.frame = frame;
        frame.add(this);
        frame.validate();
        frame.setSize(930, 686);
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        addHandles = new javax.swing.JButton();
        deleteHandles = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jTextField1 = new javax.swing.JTextField();
        jButton3 = new javax.swing.JButton();
        Button4 = new javax.swing.JButton();
        Button3 = new javax.swing.JButton();
        Button1 = new javax.swing.JButton();
        logoutButton = new javax.swing.JButton();

        setLayout(null);

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Name", "User Type", "Username", "Password"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTable1);

        add(jScrollPane1);
        jScrollPane1.setBounds(257, 136, 600, 307);

        jList1.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "1 - Wisdom (English)", "2 - Piety (English)", "3 - Justice (Science)", "4 - Perseverance (Filipino)" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane2.setViewportView(jList1);

        add(jScrollPane2);
        jScrollPane2.setBounds(260, 480, 290, 138);

        addHandles.setText("Add");
        add(addHandles);
        addHandles.setBounds(260, 620, 70, 25);

        deleteHandles.setText("Delete");
        add(deleteHandles);
        deleteHandles.setBounds(330, 620, 69, 25);

        jLabel1.setText("Sections Handled:");
        add(jLabel1);
        jLabel1.setBounds(260, 450, 103, 16);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/introsemp/add.png"))); // NOI18N
        jButton1.setText("New Faculty Member"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        add(jButton1);
        jButton1.setBounds(580, 520, 286, 41);

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/introsemp/edit.png"))); // NOI18N
        jButton2.setText("Edit Faculty Member Details");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        add(jButton2);
        jButton2.setBounds(580, 570, 286, 41);

        jLabel2.setText("Filter by:");
        add(jLabel2);
        jLabel2.setBounds(570, 450, 51, 16);

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Filipino Teachers", "Science Teachers", "Math Teachers", "Advisers" }));
        add(jComboBox1);
        jComboBox1.setBounds(580, 480, 286, 31);
        add(jTextField1);
        jTextField1.setBounds(580, 620, 182, 26);

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/introsemp/search.png"))); // NOI18N
        jButton3.setText("Search");
        add(jButton3);
        jButton3.setBounds(770, 620, 97, 29);

        Button4.setContentAreaFilled(false);
        Button4.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        Button4.setFocusPainted(false);
        Button4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button4ActionPerformed(evt);
            }
        });
        add(Button4);
        Button4.setBounds(40, 280, 147, 33);

        Button3.setContentAreaFilled(false);
        Button3.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        Button3.setFocusPainted(false);
        Button3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button3ActionPerformed(evt);
            }
        });
        add(Button3);
        Button3.setBounds(40, 240, 140, 30);

        Button1.setContentAreaFilled(false);
        Button1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        Button1.setFocusPainted(false);
        Button1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button1ActionPerformed(evt);
            }
        });
        add(Button1);
        Button1.setBounds(40, 160, 140, 30);

        logoutButton.setFont(new java.awt.Font("Verdana", 0, 13)); // NOI18N
        logoutButton.setText("Log out");
        logoutButton.setContentAreaFilled(false);
        logoutButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logoutButtonActionPerformed(evt);
            }
        });
        add(logoutButton);
        logoutButton.setBounds(70, 630, 83, 25);
    }// </editor-fold>//GEN-END:initComponents

private void Button4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button4ActionPerformed
    remove();
    ComponentsUI com = new ComponentsUI(1);
    com.setFrame(frame);// TODO add your handling code here:
}//GEN-LAST:event_Button4ActionPerformed

private void Button3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button3ActionPerformed
    remove();
    GradeBreakdownUI g = new GradeBreakdownUI(1);
    g.setFrame(frame);// TODO add your handling code here:
}//GEN-LAST:event_Button3ActionPerformed

private void Button1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button1ActionPerformed

    SectionsUI s = new SectionsUI();
    s.setFrame(frame);
    remove();
    // TODO add your handling code here:
}//GEN-LAST:event_Button1ActionPerformed

private void logoutButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logoutButtonActionPerformed
        JDialog dbox = new JDialog();
    dbox.setSize(400,250);
    int response = JOptionPane.showConfirmDialog(
                    dbox, "Are you sure you want to log out?", " ", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
            if (response == JOptionPane.YES_OPTION ) {
                dbox.dispose();
                System.exit(0);
            } else if (response == JOptionPane.NO_OPTION ) {
                dbox.dispose();
            }// TODO add your handling code here:
}//GEN-LAST:event_logoutButtonActionPerformed

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    JDialog dbox = new JDialog();
    JOptionPane.showMessageDialog(dbox,"Function is not yet available.\n"+" ");
    // TODO add your handling code here:
}//GEN-LAST:event_jButton1ActionPerformed

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    JDialog dbox = new JDialog();
    JOptionPane.showMessageDialog(dbox,"Function is not yet available.\n"+" ");
    // TODO add your handling code here:
}//GEN-LAST:event_jButton2ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Button1;
    private javax.swing.JButton Button3;
    private javax.swing.JButton Button4;
    private javax.swing.JButton addHandles;
    private javax.swing.JButton deleteHandles;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JList jList1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JButton logoutButton;
    // End of variables declaration//GEN-END:variables
}
